Texture mapping has been used to add realism to three-dimensional images in computer graphics. Texture mapping maps an image, either digitized or synthesized, onto a surface. The image is called a texture map, and its individual elements are referred to as texels. A three-dimensional image in texture mapping is mapped to a plurality of two-dimensional (2-D) coordinate pairs. The plurality of 2-D coordinate pairs are generated on a (u, v) texture coordinate (TC) space. At each pixel, selected texels are used to substitute for or to scale one or more of the image's surface. One pixel is generally covered by a number of texels. The texels are often used to interpolate the pixel when the pixel does not match one of the integer texels.
FIG. 1 is a spatial diagram of interpolating four neighboring integer texels to obtain the value of a color texel in a (u, v) texture coordinate space. The four neighboring integer coordinate texels in the texture map form a quadrilateral to approximate the actual location of the value of color due to the surface curvature. The value of color at coordinate (u, v), denoted by the symbol C(u, v), is surrounded by four neighboring coordinate texels which are integer numbers. The symbol C0(ui, vi) denotes a first texel located in the nearest upper-left corner relative to the C(u, v) color texel. The symbol C1(ui+1, vi) denotes a second texel located in the nearest upper-right corner relative to the C(u, v) color texel. The symbol C2(ui, vi+1) denotes a third texel located in the nearest lower-left corner relative to the C(u, v) color texel. The symbol C3(ui+1, vi+1) denotes a fourth texel located in the nearest lower-right corner relative to the C(u, v) color texel. Bi-linear filtering or interpolation techniques are used to compute the C(u, v) color texel if the C(u, v) color texel does not match one of the integer texels stored in a texel buffer. The bi-linear interpolation for the four neighboring texels is calculated using the following equations: ##EQU1##
Based on these equations, the color texel C(u, v) is determined from interpolating the four neighboring integer texels C0, C1, C2, and C3, in the event that the (u, v) point is not an integer.
In FIG. 2, there is shown a prior art block diagram of a texel buffer 10 that stores data in a conventional sequence. The texel buffer 10 includes a first memory bank 11, a second memory bank 12, a third memory bank 13, and a fourth memory bank 14. Each of the memory banks 11-14 has an input coupled to a memory address signal MA and has an output coupled to a 64-bit bus 15. The first memory bank 11 stores a first set of texels, including coordinate pairs of (0, 0), (4, 0), (0, 1), (4, 1), (0, 2), (4, 2), (0, 3), and (4, 3). The second memory bank 12 stores a second set of texels, containing coordinate pairs of (1, 0), (5, 0), (1, 1), and (5, 1). The third memory bank 13 stores a third set of texels, including coordinate pairs of (2, 0), (6, 0), (2, 1), and (6, 1). The fourth memory bank stores a fourth set of texels, containing coordinate pairs of (3, 0), (7, 0), (3, 1), and (7, 1).
In this conventional structure, the texel buffer 10 needs to access the memory banks 11, 12, 13 and 14 multiple times in order to retrieve the four neighboring texels C0, C1, C2, and C3. For example, if a color texel falls within the four neighboring texels of C0(0, 0), C1(1, 0), C2(0, 1), and C3(1, 1), then the texel buffer 10 must perform two accesses to retrieve the four neighboring texels to interpolate the color texel C. During the first access, the texel buffer 10 retrieves the texel C0(0, 0) from the memory bank 11 and the texel C1(1, 0) from the memory bank 12. The texel buffer 10 will not be able to retrieve the texels (0, 1) and (1, 1) because both of these texels are stored in the memory banks 11 and 12, respectively. Only one access to a particular memory bank is permitted at a time. During the second cycle, the texel buffer 10 retrieves the texel C2(0, 1) from the memory bank 11 and the texel C3(1, 1) from the memory bank 12 to complete the retrieval process of the four neighboring texels. Under this scenario, the texel buffer 10 must perform two read cycles to retrieve the four neighboring texels because the memory bank 11 contains C0 and C2 texels and the bank 12 contains C1 and C3 texels, rather than storing each of the neighboring texels in separate memory banks for parallel access. Worst yet, if the texel buffer 10 attempts to retrieve texels C0(3,0), C1(4, 0), C2(3, 1), and C3(4, 1), then the texel buffer 10 must perform four read cycles to retrieve the four neighboring texels given that C0, C1, C2, and C3 are all stored in the same memory bank, i.e., the memory bank 14. In either illustrations, the minimum number of cycles to read the four neighboring texels is two. As a result, the overall system performance is degraded from the additional read cycles necessary to retrieve the four neighboring texels for interpolation of a color texel.
Accordingly, it is desirable to have a texel buffer that stores and retrieves the four neighboring integer texels in a single cycle to minimize the memory access time.